<?php

namespace App\Http\Controllers\Sys_api;


use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\User;


/**
 * 用户登录
 */
class LoginAPIController extends BaseAPIController
{
    /**
     * 用户登录API
     *
     * @return void
     */
    public function LoginAPI(Request $request)
    {
        $data['user_tel'] = $request->input('phoneNumber');
        $res = User::UserReg($data);
        $arr = [
            'total' => 1,
            'data' => $res
        ];
        return $this->rjson($arr);
    }
    

    /**
     * 会员信息
     *
     * @return void
     */
    public function UserInfoAPI(Request $request)
    {
        $uid = $request->input('uid');
        $res = User::where('id',$uid)->first();
        if($res){
            $arr = [
                'total' => 1,
                'data' => $res
            ];
            return $this->rjson($arr);
        }
        return false;
    }

}



